//---------------------------------------------------------------------------

#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include "cxClasses.hpp"
#include "cxControls.hpp"
#include "cxGraphics.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "dxNavBar.hpp"
#include "dxNavBarBase.hpp"
#include "dxNavBarCollns.hpp"
#include "dxBar.hpp"
#include <ExtCtrls.hpp>
#include <ToolWin.hpp>
#include <ImgList.hpp>
#include <DB.hpp>
#include <Consts.hpp>
#include <ActnList.hpp>
#include <TimerDef.hpp>
#include <TimerMan.hpp>
#include "kmNetUpdate.hpp"
#include "uException.hpp"

//---------------------------------------------------------------------------
class TfrMain : public TForm
{
__published:	// IDE-managed Components
	TStatusBar *sb;
	TEdit *edKodOp;
	TdxBarManager *dxBarMenu;
	TdxBar *brMain;
	TdxBarButton *dxPROSM_LIC;
	TdxBarButton *dxKART_ABON;
	TdxBarSubItem *mNSI;
	TdxBarSubItem *dxBarSubItem2;
	TdxBarButton *dxSPR_TARIF;
	TdxBarButton *dxSPR_PRIB;
	TdxBarButton *dxSPR_UL;
	TdxBarButton *dxSPR_PUNKT;
	TdxBarButton *dxSPR_LG;
	TdxBarButton *dxSPR_KONTROLER;
	TdxBarButton *dxSPR_GEU;
	TdxBarButton *dxKLASSIFIK;
	TdxBarSubItem *mSPR_INF;
	TdxBarSubItem *mVVOD_DAN;
	TdxBarSubItem *mRASHETI;
	TdxBarSubItem *mBDGO;
	TdxBarSubItem *mREPORTS;
	TdxBarSubItem *mSERVIS;
	TdxBarButton *mAdmin;
	TdxBarButton *dxOBR_POCHTA;
	TdxBarButton *dxORB_ERIP;
	TdxBarButton *dxPRIEM_ZAYV;
	TdxBarButton *dxVDGO;
	TdxBarSubItem *mSPR_VDGO;
	TdxBarButton *dxSPR_HAR_JOB;
	TdxBarButton *dxSPR_JOB;
	TdxBarButton *dxSPR_SOTR_VDGO;
	TdxBarButton *dxSPR_DOLGNOSTI;
	TdxBarButton *dxRAION;
	TdxBarButton *dxBarButton1;
	TdxBarButton *dxKOTEL;
	TdxBarButton *dxBPG;
	TdxBarButton *dxCounter;
	TdxBarButton *dxPLIT;
	TdxBarButton *dxOTHER_PRIB;
	TdxBarButton *dxDVIJ_JIL;
	TdxBarButton *dxABON_LG;
	TdxBarCombo *dxBarCombo1;
	TdxBarButton *dxBarButton2;
	TdxBarButton *dxBarButton11;
	TdxBarCombo *dxBarCombo2;
	TdxBarSubItem *mUPR_ADMIN;
	TdxBarButton *dxUSER;
	TdxBarButton *dxBarButton3;
	TdxBarSubItem *dxBarSubItem1;
	TdxBarSubItem *dxBarSubItem3;
	TdxBarSubItem *mProb;
	TdxBarSubItem *dxBarSubItem4;
	TdxBarSubItem *mVVOD_OPLAT;
	TdxBarSubItem *mVVOD_PERESH;
	TdxBarSubItem *mVVOD_OTKL_PRIB;
	TdxBarSubItem *mVVOD_KOL_PROJ;
	TdxBarSubItem *dxBarSubItem5;
	TdxBarButton *dxVVOD_OPLOMB;
	TdxBarButton *dxKOR_BRON;
	TdxBarButton *dxPOV_SHT;
	TdxBarButton *dxKOR_POK_SHT;
	TdxBarSubItem *mVVOD_AKT_SVER;
	TdxBarButton *dxPR_MER;
	TdxBarButton *dxTARIF_SHT;
	TdxBarButton *dxZAMEN_SHT;
	TdxBarButton *dxVVOD_OP;
	TdxBarButton *dxPROSM_KOR;
	TdxBarButton *dxKOR_POK_SCH;
	TdxBarButton *dxVVOD_POK_SCH;
	TdxBarButton *dxVVOD_AKTA_SVER;
	TdxBarButton *dxPROSM_AKTA_SV;
	TdxBarButton *dxPRINT_AKTA_SV;
	TdxBarButton *dxNE_PROZV_SV;
	TdxBarButton *dxPROV_VVODA_AKT_SV;
	TdxBarButton *dxVYBYTIE;
	TdxBarButton *dxSOOTV_TRF_PRIB;
	TdxBarButton *dxVVOD_OTKL_PRIB;
	TdxBarButton *dxPROSM_OTKL_PRIB;
	TdxBarButton *dxVVOD_PERESH;
	TdxBarButton *dxPROSM_PERESH;
	TdxBarSubItem *mNATHISL;
	TdxBarButton *dxSOZD_NORM;
	TdxBarButton *dxRASH_PO_TRF;
	TdxBarButton *dxRASH_PO_SHT;
	TdxBarButton *dxPR_MNOG;
	TdxBarButton *dxBarButton4;
	TImageList *ImageList1;
	TdxBarButton *dxBarButton5;
	TdxBarSubItem *mSLUG_FUNKZII;
	TdxBarButton *mPROSM_NATH;
	TActionList *alMain;
	TdxBarButton *dxPROSM_NATH;
	TdxBarSubItem *mPROSM_NATH_TRF;
	TdxBarButton *dxPROSM_PO_ABON;
	TdxBarButton *dxPROSM_PO_VSEM;
	TdxBarSubItem *mPROSM_NATH_PO_TRF;
	TdxBarButton *dxPROSM_NATH_VIB;
	TdxBarButton *dxPROSM_NATH_PO_VSEM;
	TdxBarButton *dxACTION_JURNAL;
	TdxBarButton *dxOTOPIT_SEZON;
	TdxBarSubItem *mPOVERKA;
	TdxBarButton *dxSPR_OBMEN;
	TdxBarButton *dxNATH_POV;
	TdxBarButton *dxPROSM_POV;
	TdxBarButton *dxKON_POV;
	TdxBarSubItem *mNATH_POV;
	TdxBarButton *dxPROV_NATH_COUNTER;
	TdxBarButton *dxPROV_NATH_KALATH;
	TdxBarSubItem *mKON_POV;
	TdxBarButton *dxKON_POV_SCH;
	TdxBarButton *dxKON_POV_KALATH;
	TdxBarButton *dx7OF;
	TdxBarSubItem *sitmDataChange;
	TdxBarButton *itmReceiveRUPS;
	TdxBarButton *itmSendRUPS;
	TdxBarButton *itmReceiveERIP;
	TdxBarButton *itmSendERIP;
	TdxBarButton *dxOptions;
	TdxBarSeparator *dxBarSeparator1;
	TdxBarButton *dxReChange;
	TkmNetUpdate *updChecker;
	TAction *actMailClient;
	TdxBarButton *dxAppOptions;
	TImageList *ilBoxes;
	TdxBarSubItem *mZAMENA_SCH;
	TdxBarButton *dxZAMENA_SCH;
	TdxBarButton *dxPR_ZAMENA_SCH;
	TdxBarButton *dxOPERAT_UTHET;
	TdxBarSubItem *mPROVERKA;
	TdxBarButton *dxPROV_TRF_PRIB;
	void __fastcall FormKeyPress(TObject *Sender, char &Key);
	void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall dxSPR_TARIFClick(TObject *Sender);
	void __fastcall dxSPR_LGClick(TObject *Sender);
	void __fastcall dxSPR_GEUClick(TObject *Sender);
	void __fastcall dxSPR_KONTROLERClick(TObject *Sender);
	void __fastcall dxSPR_PUNKTClick(TObject *Sender);
	void __fastcall dxSPR_ULClick(TObject *Sender);
	void __fastcall dxSPR_PRIBClick(TObject *Sender);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall dxPROSM_LICClick(TObject *Sender);
	void __fastcall dxKART_ABONClick(TObject *Sender);
	void __fastcall dxPRIEM_ZAYVClick(TObject *Sender);
	void __fastcall dxSPR_HAR_JOBClick(TObject *Sender);
	void __fastcall dxSPR_JOBClick(TObject *Sender);
	void __fastcall dxSPR_SOTR_VDGOClick(TObject *Sender);
	void __fastcall dxSPR_DOLGNOSTIClick(TObject *Sender);
	void __fastcall dxRAIONClick(TObject *Sender);
	void __fastcall dxKLASSIFIKClick(TObject *Sender);
	void __fastcall dxKOTELClick(TObject *Sender);
	void __fastcall dxBPGClick(TObject *Sender);
	void __fastcall dxCounterClick(TObject *Sender);
	void __fastcall dxPLITClick(TObject *Sender);
	void __fastcall dxOTHER_PRIBClick(TObject *Sender);
	void __fastcall dxDVIJ_JILClick(TObject *Sender);
	void __fastcall dxABON_LGClick(TObject *Sender);
	void __fastcall dxUSERClick(TObject *Sender);
	void __fastcall dxPR_MERClick(TObject *Sender);
	void __fastcall dxTARIF_SHTClick(TObject *Sender);
	void __fastcall dxVVOD_OPLOMBClick(TObject *Sender);
	void __fastcall dxVVOD_OPClick(TObject *Sender);
	void __fastcall dxVVOD_POK_SCHClick(TObject *Sender);
	void __fastcall dxPROSM_KORClick(TObject *Sender);
	void __fastcall dxKOR_POK_SCHClick(TObject *Sender);
	void __fastcall dxVVOD_AKTA_SVERClick(TObject *Sender);
	void __fastcall dxPROSM_AKTA_SVClick(TObject *Sender);
	void __fastcall dxVYBYTIEClick(TObject *Sender);
	void __fastcall dxSOOTV_TRF_PRIBClick(TObject *Sender);
	void __fastcall dxVVOD_OTKL_PRIBClick(TObject *Sender);
	void __fastcall dxPROSM_OTKL_PRIBClick(TObject *Sender);
	void __fastcall dxVVOD_PERESHClick(TObject *Sender);
	void __fastcall dxPROSM_PERESHClick(TObject *Sender);
	void __fastcall dxRASH_PO_TRFClick(TObject *Sender);
	void __fastcall dxRASH_PO_SHTClick(TObject *Sender);
	void __fastcall dxPR_MNOGClick(TObject *Sender);
	void __fastcall bt2Click(TObject *Sender);
	void __fastcall ToolButton1Click(TObject *Sender);
	void __fastcall mPROSM_NATHClick(TObject *Sender);
	void __fastcall dxPROSM_NATH_PO_VSEMClick(TObject *Sender);
	void __fastcall dxPROSM_NATH_VIBClick(TObject *Sender);
	void __fastcall dxACTION_JURNALClick(TObject *Sender);
	void __fastcall dxOTOPIT_SEZONClick(TObject *Sender);
	void __fastcall dxSPR_OBMENClick(TObject *Sender);
	void __fastcall dxPROSM_POVClick(TObject *Sender);
	void __fastcall dxPROV_NATH_COUNTERClick(TObject *Sender);
	void __fastcall dxPROV_NATH_KALATHClick(TObject *Sender);
	void __fastcall dxKON_POV_SCHClick(TObject *Sender);
	void __fastcall dxKON_POV_KALATHClick(TObject *Sender);
	void __fastcall dx7OFClick(TObject *Sender);
	void __fastcall actMailClientExecute(TObject *Sender);
	void __fastcall dxAppOptionsClick(TObject *Sender);
	void __fastcall dxKOR_BRONClick(TObject *Sender);
	void __fastcall dxPR_ZAMENA_SCHClick(TObject *Sender);
	void __fastcall dxZAMENA_SCHClick(TObject *Sender);
	void __fastcall dxPROV_TRF_PRIBClick(TObject *Sender);
private:	// User declarations
	bool DBConnected();
	void __fastcall SetRole();
	void __fastcall ShowHint(TObject *Sender);
	void __fastcall AutoUpdate();
	void __fastcall TimerNotifyIvent(TObject* Sender, unsigned Msg, unsigned UserParam);

public:		// User declarations
	bool FCanRun;
	String POLE_ROL,MES_RASH,GOD_RASH,RASH_PER,Us;
	__fastcall TfrMain(TComponent* Owner);
	void __fastcall TfrMain::RASH_PERIOD();
	void __fastcall TfrMain::VIDIMOST();
	void __fastcall GetAppOptions();
	void __fastcall SetAppOptions();
	void __fastcall GetAccountOptions(AnsiString Account);
	void __fastcall SetAccountOptions(AnsiString Account);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrMain *frMain;
//---------------------------------------------------------------------------
#endif
